var t = require;
var e = module;
var o = exports;
Object.defineProperty(o, "__esModule", {value: !0});
var n = 0,
    r = (function () {
        function t() {
            this.s = new Array();
        }
        return (
            (t.prototype.delay = function (t) {
                t.group || (t.group = "default"),
                    t.name || (t.name = "#" + ++n),
                    t.time > 0 || (t.time = 0),
                    this.clear(t.group, t.name),
                    this.s.push(t);
            }),
            (t.prototype.clear = function (t, e) {
                var o = this.s.length;
                if (e)
                    for (; o--; ) {
                        (n = this.s[o]) && n.group == t && n.name == e && ((n.action = null), (this.s[o] = null));
                    }
                else
                    for (; o--; ) {
                        var n;
                        (n = this.s[o]) && n.group == t && ((n.action = null), (this.s[o] = null));
                    }
            }),
            (t.prototype.clearAll = function () {
                for (var t = 0, e = this.s; t < e.length; t++) {
                    var o = e[t];
                    o && (o.action = null);
                }
                this.s.length = 0;
            }),
            (t.prototype.step = function (t) {
                for (var e = -1, o = 0, n = this.s; o < n.length; o++) {
                    e++, (r = n[o]) && ((r.time -= t) > 0 || (r.action(), (r.action = null), (this.s[e] = null)));
                }
                for (e = this.s.length; e--; ) {
                    var r;
                    (r = this.s[e]) || this.s.splice(e, 1);
                }
            }),
            t
        );
    })();
o.default = r;
